/**
 * @author : cyb1010
 * @date   : 2024-05-30 12:27:36
 * @file   : bracket.cpp
 */
#include <bits/stdc++.h>
using namespace std;
#define fo(s) freopen(s ".in", "r", stdin), freopen(s ".out", "w", stdout)
#define fi first
#define se second
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
int __, n, x[310], tot, ans;
char s[310];
int pre[310], suf[310];
bool chk() {
    int t = 0, pos;
    for (int i = n - 1; ~i; i--) {
        s[i] == ')' ? t++ : t--, suf[i] = t, pos = i;
        if (suf[i] < 0) break;
    }
    if (!pos && suf[0] == 0) return 1;
    t = 0;
    for (int i = 0, tt = 0; i < n; i++) {
        tt = t, s[i] == '(' ? t++ : t--, pre[i] = t;
        for (int j = i; j < n; j++) {
            s[j] == '(' ? tt-- : tt++;
            if (tt < 0) break;
            if (j < pos) continue;
            if (tt == suf[j + 1]) return 1;
        }
        if (pre[i] < 0) return 0;
    }
    return 0;
}
int main() {
    fo("bracket");
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> s;
    if (n & 1) return cout << "0\n", 0;
    for (int i = 0; i < n; i++)
        if (s[i] == 'x') x[tot++] = i;
    const int T = 1 << tot;
    for (int i = 0; i < T; i++) {
        for (int j = 0; j < tot; j++) s[x[j]] = '(' ^ (i >> j & 1);
        // for (int j = 0; j < n; j++) cerr << s[j];
        // cerr << endl;
        if (chk()) ans++;
    }
    cout << ans << '\n';
    return 0 ^ __ ^ 0;
}
// 4 14 51 186 684